#!/bin/sh
#
webif_installed_mark="/tmp/.webif-installed-marker"
if [ -z "${IPKG_INSTROOT}" ]; then	# only run below on 'real' system (not image builder)
	ipkg list_installed |grep -q "kernel - 2.4.30"
	if [ "$?" != "0" ]; then
		echo "This version is for White Russian only! Please download the kamikaze version from http://downloads.x-wrt.org/xwrt/kamikaze/"
		exit 1
	fi
	# if webif^2 exists, create a temporary marker so we know any
	# one-time initialization has already occurred.
	[ -f "/www/.version" ] && {
		touch "$webif_installed_mark"
	}
	# install new httpd.conf
	if [ -f "/etc/httpd.conf" ]; then
		cp /etc/httpd.conf /tmp/httpd.conf.old        	# make a copy for comparing
	else
		echo > /tmp/httpd.conf.old
	fi
fi
